package org.liaohailong.library.widget.shopping.helper;

/**
 * Author: Victor
 * E-mail: liaohailong190@foxmail.com
 * Date: 2019/6/22 15:21
 * Description: 范围值
 */
public class ShoppingRange {
    private int startPosition;
    private int endPosition;
    private int rangeSize;

    public ShoppingRange(int startPosition, int endPosition) {
        this.startPosition = startPosition;
        this.endPosition = endPosition;
        rangeSize = endPosition - startPosition + 1;
    }

    public boolean contains(int position) {
        return startPosition <= position && position <= endPosition;
    }

    public int getRangeSize() {
        return rangeSize;
    }

    public int getStartPosition() {
        return startPosition;
    }

    public int getEndPosition() {
        return endPosition;
    }
}
